package org.niu.listnode;

public class ReverseList {
    public ListNode ReverseList(ListNode head) {
        ListNode a,b,c;
        a = head;
        b = a.next;
        c = b.next;
        a.next = null;
        while (c!=null){
            b.next = a;
            a = b;
            b = c;
            c = c.next;
        }
        b.next = a;
        return b;
    }
}
